package com.qf.smartdevice.pojo;


import org.springframework.util.StringUtils;

public class Devices implements CheckNull {

    private Long id;
    private String devicesuuid;
    private String devicename;
    private java.util.Date addtime;
    private String address;
    private Long areaid;
    private String direction;
    private Long num;
    private String status;
    private java.util.Date lastconnecttime;
    private Long categoryid;

    private Areas area;
    private Categories category;


    @Override
    public boolean isNull() {
        if (id == null) {
            return StringUtils.isEmpty(devicesuuid) && StringUtils.isEmpty(devicename) &&
                    StringUtils.isEmpty(address) && StringUtils.isEmpty(areaid) &&
                    StringUtils.isEmpty(direction);
        } else {
            return StringUtils.isEmpty(devicesuuid) || StringUtils.isEmpty(devicename) ||
                    StringUtils.isEmpty(address) || StringUtils.isEmpty(areaid) ||
                    StringUtils.isEmpty(direction) || StringUtils.isEmpty(status);
        }
    }

    public Areas getArea() {
        return area;
    }

    @Override
    public String toString() {
        return "Devices{" +
                "id=" + id +
                ", devicesuuid='" + devicesuuid + '\'' +
                ", devicename='" + devicename + '\'' +
                ", addtime=" + addtime +
                ", address='" + address + '\'' +
                ", areaid=" + areaid +
                ", direction='" + direction + '\'' +
                ", num=" + num +
                ", status='" + status + '\'' +
                ", lastconnecttime=" + lastconnecttime +
                ", categoryid=" + categoryid +
                ", area=" + area +
                ", category=" + category +
                '}';
    }

    public void setArea(Areas area) {
        this.area = area;
    }

    public Categories getCategory() {
        return category;
    }

    public void setCategory(Categories category) {
        this.category = category;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }


    public String getDevicesuuid() {
        return devicesuuid;
    }

    public void setDevicesuuid(String devicesuuid) {
        this.devicesuuid = devicesuuid;
    }


    public String getDevicename() {
        return devicename;
    }

    public void setDevicename(String devicename) {
        this.devicename = devicename;
    }


    public java.util.Date getAddtime() {
        return addtime;
    }

    public void setAddtime(java.util.Date addtime) {
        this.addtime = addtime;
    }


    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }


    public Long getAreaid() {
        return areaid;
    }

    public void setAreaid(Long areaid) {
        this.areaid = areaid;
    }


    public String getDirection() {
        return direction;
    }

    public void setDirection(String direction) {
        this.direction = direction;
    }


    public Long getNum() {
        return num;
    }

    public void setNum(Long num) {
        this.num = num;
    }


    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }


    public java.util.Date getLastconnecttime() {
        return lastconnecttime;
    }

    public void setLastconnecttime(java.util.Date lastconnecttime) {
        this.lastconnecttime = lastconnecttime;
    }


    public Long getCategoryid() {
        return categoryid;
    }

    public void setCategoryid(Long categoryid) {
        this.categoryid = categoryid;
    }

}
